<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>sql.js</title>
		<script src='sql.js'></script>
	</head>
	<body>
		<script>
		    // 引用sql.js 实例化
		    var db = new SQL.Database();
		
		
		    // 创建数据表
		    sqlstr = "CREATE TABLE hello (a int, b char);";
		    sqlstr += "INSERT INTO hello VALUES (0, 'hello');"
		    sqlstr += "INSERT INTO hello VALUES (1, 'world');"
		    db.run(sqlstr); // Run the query without returning anything
		
		    // 查询表
		    var res3 = db.exec("select * from hello");
		
		</script>
	</body>
</html>
